<template>
  <div class='add-sign'>
    <router-view />
  </div>
</template>
<script>
export default {
  components: {},
  name: "",
  data() {
    return {
      signInfo:{}
    };
  },
  methods: {
    checkSign(){
      _g.apiPost("Attendance/checkSignIn",{}).then(res=>{
        this.signInfo=res
        if(res.id)this.$dialog.confirm({
          className:"check-login",
          title: '提示',
          message: '您还有未完成的签到！',
          cancelButtonText:"结束",
          confirmButtonText:"跳转"
        }).then(() => {
          // on confirm
          this.$router.replace("/attendance/sign/signDetail/"+res.id)
        }).catch(() => {
          // on cancel
          _g.apiPost("Attendance/endSignIn",{id:res.id}).then(res=>{
            _g.toMessage(res)
          })
        });
      })
    }
  },
  created() {
    this.checkSign()
  }
};
</script>
<style lang="scss" scoped>
.add-sign {
}
</style>